package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.mapper.DtsFootprintMapper;
import com.qf.pojo.DtsFootprint;
import com.qf.service.DtsFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author Cc
 * @version 1.0
 */
@Service
public class DtsFeedbackServiceImpl implements DtsFeedbackService {

    @Autowired
    private DtsFootprintMapper dtsFootprintMapper;
    @Override
    public IPage<DtsFootprint> page(Integer page, Integer limit, String sort, String order) {
        return dtsFootprintMapper.selectPage(new Page<>(page, limit),
                new QueryWrapper<DtsFootprint>()
                        .eq("deleted", false)
                        .orderBy(!StringUtils.isEmpty(sort),"desc".equalsIgnoreCase(order),sort));
    }
}
